my file learn about tech container (docker, podman, kubernetes)
kubectl create -f persistentVolume.yaml
kubectl get pv
kubectl describe pv <name_pv>
kubectl get pvc # persistent volume claim
kubectl describe pvc <name_pvc>
kubectl delete pv <name_pv>
kubectl delete pvc <name_pvc>
apiVersion: v1
kind: PersistentVolume
metadata:
name: persistent-volume-name
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 5Gi
hostPath:
path: /data/location
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: persistent-volume-claim-name
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 1Gi
apiVersion: v1
kind: PersistentVolume
metadata:
name: nodejs-writer-volume
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 5Gi
hostPath:
path: /data/location
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nodejs-writer-volume-claim
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Pod
metadata:
name: nodejs-writer
labels:
name: nodejs-writer
spec:
volumes:
- name: html
persistentVolumeClaim:
claimName: nodejs-writer-volume-claim
containers:
- name: nodejs-writer
image: khannedy/nodejs-writer
volumeMounts:
- mountPath: /app/html
name: html
kubectl create -f 04\ -\ persistent-volume.yaml
kubectl get -f 04\ -\ persistent-volume.yaml
kubectl exec -it nodejs-writer -- /bin/sh
/ # ls /app/html/
# index.html